'''
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with self work for additional information
 * regarding copyright ownership.  The ASF licenses self file
 * to you under the Apache License, Version 2.0 (the
 * "License") you may not use self file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
'''


#import java.util.*;

#import org.apache.jena.reasoner.rulesys.Rule;

'''
 * A RuleSet wraps a list of rules.
'''
RuleSet
    private static final List<Rule> emptyRules = Collections.emptyList()

    public static final RuleSet empty = create(emptyRules)

    # param List<Rule> rules
    # result static RuleSet
    def create(self, rules):
        return RuleSet(rules)
    

    # param String ruleString
    # result static RuleSet
    def create(self, ruleString):
        return create(Rule.parseRules(ruleString))
    

    private final List<Rule> rules

    protected RuleSet(List<Rule> rules):
        self.rules = ArrayList<>(rules)
    

    # param 
    # result List<Rule>
    def getRules(self):
        return rules
    

    # @Override
    # param 
    # result int
    def hashCode(self):
        return rules.hashCode()
    

    # @Override
    # param Object other
    # result boolean
    def equals(self, other):
        return other instanceof RuleSet and rules.equals(((RuleSet) other).rules)
    


